from django.contrib import admin
from www import models


@admin.register(models.Coupon)
class CouponAdmin(admin.ModelAdmin):
    list_display = ['id', 'code', 'status', 'memo', 'create_date', 'user', ]


@admin.register(models.User)
class UserAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'user_type', 'phone']
    list_display_links = ['name']


@admin.register(models.Course)
class CourseAdmin(admin.ModelAdmin):
    list_display = ["title", 'sub_title', "teacher", "order", 'category']


@admin.register(models.Chapter)
class ChapterAdmin(admin.ModelAdmin):
    list_display = ['course', 'title', "order"]
    list_display_links = ['title']


@admin.register(models.Video)
class VideoAdmin(admin.ModelAdmin):
    list_display = ['course', "chapter", 'title', 'vid', "order", ]
    list_display_links = ['title']


@admin.register(models.Order)
class OrderAdmin(admin.ModelAdmin):
    list_display = ["oid", "pay_method", "amount", 'status', 'user', 'pay_date']
    list_display_links = ['oid']
